package com.purchase.ml.config;

/**
 * @author :zxm
 * @date :2021/2/25 17:42
 * @description :对象映射工具
 **/

import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OrikaConfig {

    /**
     * 从orika里面获取一个工具
     * @return
     */
    @Bean
    public MapperFacade mapperFacade(){
        DefaultMapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
        MapperFacade mapperFacade = mapperFactory.getMapperFacade();
        return mapperFacade;
    }
}